<template>
    <div class="electronic-form-block">
        <div class="electronic-title">报关企业基本信息</div>
        <Form class="declare-form" :model="form" :label-width="150">
            <FormItem label="统一社会信用代码">
                <Input
                    v-model="form.socialCreditCode"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="企业名称">
                <Input
                    v-model="form.enterpriseName"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="企业海关编码">
                <Input
                    v-model="form.enterpriseCustomsCode"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="主管海关编码">
                <Input
                    v-model="form.competentCustomsCode"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="主管海关名称">
                <Input
                    v-model="form.competentCustomsName"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="当前登记状态">
                <Input
                    :value="form.currentRegistStatus | registStatusFmt"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="登记日期">
                <Input
                    v-model="form.registDate"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="当前登记有效期">
                <Input
                    v-model="form.validTime"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="有效截止日期">
                <Input
                    v-model="form.expiryDate"
                    :disabled="disabled"
                />
            </FormItem>
        </Form>
    </div>
</template>
<script>
import filters from '../mixins/filters'

export default {
    mixins: [ filters ],
    props: {
        value: {
            type: Object,
            default: () => ({})
        }
    },
    data () {
        return {
            disabled: true,
            form: {}
        }
    },
    watch: {
        value: {
            handler (v) {
                this.setForm(v)
            },
            immediate: true
        }
    },
    methods: {
        setForm (v) {
            this.form = JSON.parse(JSON.stringify(v))
        }
    }
}
</script>
